﻿using System;
using fastCSharp;

namespace diantou.web.tutorial
{
    /// <summary>
    /// 用户
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class userList : view<userList>
    {
        /// <summary>
        /// 用户集合
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private user.userRelation[] users;
        /// <summary>
        /// 关注用户
        /// </summary>
        /// <param name="tutorialId"></param>
        /// <param name="isPass"></param>
        /// <param name="page">分页号</param>
        /// <returns>是否成功</returns>
        private bool loadView(int tutorialId, bool isPass, int page)
        {
            if (base.load(tutorialId))
            {
                diantou.dataAccess.user[] values = diantou.dataAccess.clientCache.User.Get(diantou.dataAccess.tcpCall.focusTutorial.getUserIds(tutorialId, isPass ? dataModel.focus.type.Accepted : dataModel.focus.type.Register, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, out pageInfo.Count));
                users = values.getArray(value => new user.userRelation { User = value, UserId = currentUserId });
                if (requestHeader.IsSearchEngine) pageInfo.Path = isPass ? tutorial.Path.PassUserList.ToPageString() : tutorial.Path.UserList.ToPageString();
                return true;
            }
            return false;
        }
    }
}